home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / Slider.h < prev    next >
C/C++ Source or Header  |  1992-04-27  |  2KB  |  82 lines

  1. #ifndef Slider_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define Slider_First
  7.  
  8. #include "CompVObject.h"
  9.  
  10. class Thumb;
  11.  
  12. typedef enum {
  13.     eSliderPageUpLeft   = 1,
  14.     eSliderPageDownRight= 2,
  15.     eSliderThumb        = 3
  16. } SliderPartCodes;
  17.  
  18. //---- Slider ------------------------------------------------------------------
  19.  
  20. class Slider: public CompositeVObject {
  21. protected:
  22.     Thumb *thumb;
  23.     Direction dir;
  24.     bool feedback;
  25.     Point minVal, maxVal, currVal, bubbleSize;
  26.  
  27. public:
  28.     MetaDef(Slider);
  29.     Slider(int id= cIdNone, Direction dir= eVert, bool fb= FALSE);
  30.  
  31.     virtual Thumb *MakeThumb();
  32.     void SetContainer(VObject *v);
  33.     void Update(bool redraw= TRUE);
  34.     void SetOrigin(Point);
  35.     Command *DoLeftButtonDownCommand(Point, Token, int);
  36.     void Draw(Rectangle);
  37.     void SetVal(Point, bool redraw= FALSE);
  38.     Point GetVal()
  39.     { return currVal; }
  40.     void SetMax(Point, bool redraw= FALSE);
  41.     Point GetMax()
  42.     { return maxVal; }
  43.     void SetMin(Point, bool redraw= FALSE);
  44.     Point GetMin()
  45.     { return minVal; }
  46.     void SetThumbRange(Point, bool redraw= FALSE);
  47.     Point GetThumbRange()
  48.     { return bubbleSize; }
  49.     GrCursor GetCursor(Point);
  50.     void MoveThumb(Point);
  51.     int Where(Point);
  52.     Metric GetMinSize();
  53. };
  54.  
  55. //---- Thumb -------------------------------------------------------------------
  56.  
  57. class Thumb: public VObject {
  58.     Slider *slider;
  59.     Direction dir;
  60. public:
  61.     MetaDef(Thumb);
  62.     Thumb(Slider *sl, Direction d);
  63.     void Draw(Rectangle r);
  64.     Metric GetMinSize();
  65.     Command *DoLeftButtonDownCommand(Point, Token, int);
  66.     GrCursor GetCursor(Point);
  67. };
  68.  
  69. //---- PagerCommand ------------------------------------------------------------
  70.  
  71. class PagerCommand: public Command {
  72.     Slider *slider;
  73.     int part;
  74. public:
  75.     PagerCommand(Slider* s, int p);
  76.     void TrackFeedback(Point, Point, bool);
  77.     Command *TrackMouse(TrackPhase, Point, Point, Point);
  78. };
  79.  
  80. #endif
  81.  
  82.